package com.example.android.commitcontent.ime.keyboard.adapters;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.widget.TextView;

import com.example.android.commitcontent.ime.R;
import com.example.android.commitcontent.ime.cores.adapters.BaseSingleChooseAdapter;

import java.util.List;

/**
 * 符号键盘分类adapter
 */
public class SymbolCategoryAdapter extends BaseSingleChooseAdapter<String> {


    public SymbolCategoryAdapter(Context context, int layoutRes, List<String> dataList, int checkEventViewId, int defaultSelectedPosition) {
        super(context, layoutRes, dataList, checkEventViewId, defaultSelectedPosition);
    }

    @Override
    protected void onBindData(@NonNull String data, @NonNull Holder holder, int position) {
        TextView textView = holder.findViewById(R.id.tv_title);
        textView.setBackgroundColor(getSelectedPosition() == position ? Color.parseColor("#11000000") : Color.TRANSPARENT);
        textView.setText(data);
    }
}
